<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" template="/layout/template.xhtml">
	<ui:define name="body">
	<script language="JavaScript" type="text/javascript">
		window.history.forward(-1);
	</script>
		<h1 class="title ui-widget-header ui-corner-all">Asignar Permisos a los Empleados</h1>
		<h:form id="formPermisos">
			<p:messages id="message" showDetail="true" />
			<p:panel>
				<p:fieldset legend="Busqueda de Empleado">
					<h:panelGrid columns="6">
					
					<p:outputLabel value="#{message['permiso.personal.cargo']}" for="cargo"/>
					<p:selectOneMenu id="cargo" value="#{comboAction.cargoEmpleado}" >
					<f:selectItem itemLabel="Seleccione cargo" itemValue="#{null}" />
					<f:selectItems  value="#{comboAction.cargoEmpleadoItems}" />
					<p:ajax update="empleado"  listener="#{comboAction.cambiar2}" />
					</p:selectOneMenu>
					
					<p:outputLabel  value="#{message['permiso.personal.Empleado']}" for="empleado"/>
					<p:selectOneMenu id="empleado" value="#{permiso.idempleado}" required="true">
					<f:selectItems  value="#{comboAction.empleadoxcargo}" />
					</p:selectOneMenu>
					
					<p:commandButton action="#{permiso.agregarListas}" value="Ver Permisos" ajax="false" update="formPermisos"/>
					
					</h:panelGrid>
					
				<p:spacer width="40px" /> 
				
				<p:pickList id="pojoPickList1" value="#{permiso.permisosString}" var="p"  
				itemLabel="#{p}" itemValue="#{p}" />
				<br/> 
				<h:panelGrid columns="3" >
				<p:spacer/>
				<p:commandButton  action="#{permiso.insertar}" value="Registrar Permisos" ajax="false" update="formPermisos" icon="ui-icon ui-icon-disk" />
				</h:panelGrid>
		   	</p:fieldset>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>